<?php
namespace app\erp\validate;

use think\Validate;

class Partnerrule extends Validate
{

    protected $rule = [
        'partner_name' => 'require|min:2|unique:partner,partner_name',
        'start_time' => 'require|date',
        'amount' => 'require|float'
    ];

    protected $message = [
        'partner_name.require' => '合作伙伴不能为空',
        'partner_name.min' => '合作伙伴名称不正确',
        'partner_name.unique' => '合作伙伴名称已存在',
        'start_time.require' => '合作开始时间不能为空',
        'start_time.date' => '合作开始日期格式不正确',
        'end_time.date' => '合作结束日期不正确',
        'amount.require' => '合同金额不能为空',
        'amount.float' => '合同金额错误'
    ];
}